package org.jeecg.common.util.enums;

import com.sun.corba.se.spi.ior.ObjectKey;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author guoyh
 * @ClassName WithdrawRecordStatusEnum
 * @Description
 * @since 2020/8/27 02:42
 **/
@Getter
@AllArgsConstructor
public enum WithdrawRecordStatusEnum {

    /**状态  0 申请中  1 已审批  2 已拒绝*/
    APPLY(0,"申请中"),
    AGREE(1,"已审批"),
    REFUND(2,"已拒绝"),
    ;


    private int code;

    private String desc;

    public static WithdrawRecordStatusEnum getInstance(Integer code){
        return Arrays.stream(values()).filter(item -> Objects.equals(code,item.getCode())).findFirst().orElse(null);
    }
}
